package com.qf.smsplatform.util;

import com.qf.smsplatform.common.enums.InterfaceExceptionEnums;
import com.qf.smsplatform.common.exception.SmsException;
import com.qf.smsplatform.vo.ResultVO;

public class R {

    public static ResultVO ok(){
        ResultVO vo  = new ResultVO();
        vo.setCode(0);
        vo.setMsg("接收成功");
        return vo;
    }

    public static ResultVO error(InterfaceExceptionEnums enums){
        ResultVO vo  = new ResultVO();
        vo.setCode(enums.getCode());
        vo.setMsg(enums.getMessage());
        return vo;
    }

    public static ResultVO error(SmsException ex){
        ResultVO vo  = new ResultVO();
        vo.setCode(ex.getCode());
        vo.setMsg(ex.getMessage());
        vo.setData(ex.getData());
        return vo;
    }




}
